<%@ page pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<style type="text/css">
.error {
	display: inline;
	color: red;
	font-family: 黑体;
	font-size: 12px;
}

.error2 {
	color: red;
	font-family: 黑体;
	font-size: 12px;
}

.checkboxLabel {
	display: inline;
	font-size: 18px;
}
</style>
<script type="text/javascript">
	$("#menuForm").validator(
		{},
		{
			callback :function(results) {
			$("#menuForm").ajaxSubmit(function(data) {
				 menuMyDialog.close();
	        	 menuMyDialog = art.dialog({icon: data.success,content: data.message, lock:true});
	        	 
	        	 if(data.success=='succeed') {
	    			var selectTreeNode = zTree.getSelectedNodes()[0];
	    	 		if (selectTreeNode) {
	    	 			selectTreeNode.name = data.data.text;
	    				zTree.updateNode(selectTreeNode);
	    			}
	        	 }
			});
		}
	});
	
	function checkMenuName() {
		var result = new Object();
		
		var pattern = new RegExp("[`~!@#$^&*=|{}':;',\\[\\].<>/?~！@#￥……&*（）——|{}【】‘；：”“'。，、？]");
		if($.trim($("#text").val()) != "" && $.trim($("#text").val()).match(pattern)) {
			result.result = false;
			result.msg = "不能包含特殊字符";
			return result;
		}
		
		result.result = true;
		result.msg = "输入正确";
		
		return result;
	}
	
	
	// 取消操作
	function cancelOpr() {
		menuMyDialog.close();
		return false;
	}
	
	
	<c:if test="${menu.enable == true}" >
		$("#enable").val("1");
	</c:if>
	<c:if test="${menu.enable != true}" >
		$("#enable").val("0");
	</c:if>
</script>

<form id="menuForm" method="post" action="cms/menutree_manager/modify/submit">
	<input id="parentId" name="parentId" type="hidden" type="text" value="${menu.parentId}"/>
	<input id="id" name="id" type="hidden" type="text" value="${menu.id}"/>
	<input id="systemCode" name="systemCode" type="hidden" type="text" value="${menu.systemCode}"/>
	 
	<ul class="all_list">
		<li id="orgTree001" class="dtree_frame" >
			<span class="all_title" style="width:120px;"> 父菜单：</span> 
			<span class="conent">
				${parentMenuName }
			</span>
		</li>
		<li id="orgTree001" class="dtree_frame" >
			<span class="all_title" style="width:120px;"> 菜单名称：</span> 
			<span class="conent">
				<input type="text" class="ui_input"
					id="text" name="text" value="${menu.text}" validator='{"label":"菜单名称","required":true,"maxLength":80, "customFun":"checkMenuName"}'}'/>
			</span>
		</li>
		<li>
			<span class="all_title" style="width:120px;"> 菜单URL：</span> 
			<span>
				<c:if test="${menu.parentId=='0'}">
					<input type="text" class="ui_input"
							id="url" name="url" value="${menu.url}" validator='{"label":"菜单URL","required":false,"maxLength":256}'/>
				</c:if>
				<c:if test="${menu.parentId!='0'}">
					<input type="text" class="ui_input"
							id="url" name="url" value="${menu.url}" validator='{"label":"菜单URL","required":true,"maxLength":256}'/>
				</c:if>
			</span>
		</li>
		<!-- <li>
			<span class="all_title" style="width:120px;"> 权限代码：</span> 
			<span>
				<c:if test="${menu.parentId=='0'}">
					<input type="text" class="ui_input"
						id="permisCode" name="permisCode" value="${menu.permisCode}" validator='{"label":"权限代码","required":false,"maxLength":30}'/>
				</c:if>		
				<c:if test="${menu.parentId!='0'}">
					<input type="text" class="ui_input"
						id="permisCode" name="permisCode" value="${menu.permisCode}" validator='{"label":"权限代码","required":true,"maxLength":30}'/>
				</c:if>	
			</span>
		</li> -->
		<li>
			<span class="all_title" style="width:120px;"> 启用标志：</span> 
			<span>
				<select name="enable" id="enable" 		 class="ui_input w_120" validator='{"label":"启用标志","required":true}'>
						<option value="">请选择</option>
						<option value="1">启用</option>
						<option value="0">停用</option>
				</select>
			</span>
		</li>
		<li>
			<span class="all_title" style="width:120px;"> 菜单排序：</span> 
			<span>
				<input type="text" class="ui_input"
					id="menuOrder" name="menuOrder" value="${menu.menuOrder}" validator='{"label":"菜单排序","required":true,"isDigit":true,"maxLength":16}'/>
			</span>
		</li>
		<li>
			<span class="all_title"></span>
			<span> 
				<input type="button" class="btn_blue submitBtn" value="修 改" />
				<input type="button" class="btn_blue" value="取 消" name="button" id="cancel_button" onclick="cancelOpr()" /> 
			</span>
			</li>
		</ul>
</form>